﻿using Domain;
using Microsoft.EntityFrameworkCore.Storage;

namespace Infrastructure
{
    public class UnitOfWork(UserDbContext userDbContext) : IUnitOfWork
    {
        public Task<IDbContextTransaction> BeginTransactionAsync()
        {
            return Task.FromResult(userDbContext.Database.BeginTransaction());
        }

        public Task SaveChangesAsync(CancellationToken cancellationToken)
        {
            return userDbContext.SaveChangesAsync(cancellationToken);
        }
    }
}
